package com.erp.entity.sale;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

//销货订单类
public class SaleOrder {
    private Integer id;

    private String saleOrderNumber;//销货订单编号

    private Integer customerId;//客户id
    private Integer isDelete;//0 未删除 1 已删除
    private Integer employeeId;//销售人员id
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date receiptDate;//单据日期
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date receivingDate;//收货日期

    private String customerAddress;//客户地址

    private Integer businessType;//业务类别

    private BigDecimal orderDiscountRate;//订单优惠率

    private BigDecimal orderDiscountAmount;//订单优惠金额

    private BigDecimal amountAfOrderDis;//订单优惠后金额

    private Integer deliveryTyId;//交货方式ID

    private Integer logisticsCompanyId;//物流公司ID

    private Integer receiveTyId;//收款条件id

    private Integer hasQrCode;//是否有收款二维码




    private String linkBuyOrderNumber;//关联购货订单号



    private String linkQuoteNumber;//关联报价单号

    private Integer isExamined;//是否审核

    private String examinerId;//审核人ID

    private Integer makerId;//制单人ID
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createDate;//制单时间

    private Integer saleOrderStatus;//订单状态 0 未出库 1部分出库 2全部出库
    private Integer companyId;//公司唯一ID

    private String remarks;//备注

    private BigDecimal saleOrderAmount;//订单销售金额
    private BigDecimal saleOrderTaxAmount;//订单税额
    private Integer totalGoodsNum;//订单商品数量
    private Integer prePayStatus;//订单预收款状态 0未预收 1 部分预收 2 全部预收
    private BigDecimal prePayAmount;//订单预收款金额
    //----------------冗余字段-----------------
    private List<SaleOrderDetail> saleOrderDetailList;
    private List<String> linkPrepayNumberList;//关联预收款单号list
    private List<String> linkSaleNumberList;//关联销货单号list
    private String customerName;//客户名称
    private String customerTypeName;//客户类别名称
    private String employeeName;//销售人员名称

    private String examinerName;//审核人名称
    private String makerName;//制单人名称

    public SaleOrder(){
        linkSaleNumberList = new ArrayList<>();
        linkPrepayNumberList = new ArrayList<>();
    }

    public  void setBasicInfo(String saleOrderNumber,
                              Date createDate,
                              Integer isDelete,Integer saleOrderStatus,
                              Integer prePayStatus,BigDecimal prePayAmount,
                              BigDecimal saleOrderAmount,BigDecimal saleOrderTaxAmount,
                              Integer totalGoodsNum){
        setSaleOrderNumber(saleOrderNumber);
        setCreateDate(createDate);
        setIsDelete(isDelete);
        setSaleOrderStatus(saleOrderStatus);
        setPrePayStatus(prePayStatus);
        setPrePayAmount(prePayAmount);
        setSaleOrderAmount(saleOrderAmount);
        setSaleOrderTaxAmount(saleOrderTaxAmount);
        setTotalGoodsNum(totalGoodsNum);
    }


    public List<String> getLinkPrepayNumberList() {
        return linkPrepayNumberList;
    }

    public void setLinkPrepayNumberList(List<String> linkPrepayNumberList) {
        this.linkPrepayNumberList = linkPrepayNumberList;
    }

    public List<String> getLinkSaleNumberList() {
        return linkSaleNumberList;
    }

    public void setLinkSaleNumberList(List<String> linkSaleNumberList) {
        this.linkSaleNumberList = linkSaleNumberList;
    }

    public List<SaleOrderDetail> getSaleOrderDetailList() {
        return saleOrderDetailList;
    }

    public void setSaleOrderDetailList(List<SaleOrderDetail> saleOrderDetailList) {
        this.saleOrderDetailList = saleOrderDetailList;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Integer getSaleOrderStatus() {
        return saleOrderStatus;
    }

    public void setSaleOrderStatus(Integer saleOrderStatus) {
        this.saleOrderStatus = saleOrderStatus;
    }

    public String getExaminerName() {
        return examinerName;
    }

    public void setExaminerName(String examinerName) {
        this.examinerName = examinerName;
    }

    public String getMakerName() {
        return makerName;
    }

    public void setMakerName(String makerName) {
        this.makerName = makerName;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getCustomerAddress() {
        return customerAddress;
    }

    public void setCustomerAddress(String customerAddress) {
        this.customerAddress = customerAddress;
    }

    public String getCustomerTypeName() {
        return customerTypeName;
    }

    public void setCustomerTypeName(String customerTypeName) {
        this.customerTypeName = customerTypeName;
    }

    public String getEmployeeName() {
        return employeeName;
    }

    public void setEmployeeName(String employeeName) {
        this.employeeName = employeeName;
    }

    public BigDecimal getSaleOrderAmount() {
        return saleOrderAmount;
    }

    public void setSaleOrderAmount(BigDecimal saleOrderAmount) {
        this.saleOrderAmount = saleOrderAmount;
    }

    public BigDecimal getSaleOrderTaxAmount() {
        return saleOrderTaxAmount;
    }

    public void setSaleOrderTaxAmount(BigDecimal saleOrderTaxAmount) {
        this.saleOrderTaxAmount = saleOrderTaxAmount;
    }

    public Integer getTotalGoodsNum() {
        return totalGoodsNum;
    }

    public void setTotalGoodsNum(Integer totalGoodsNum) {
        this.totalGoodsNum = totalGoodsNum;
    }

    public Integer getPrePayStatus() {
        return prePayStatus;
    }

    public void setPrePayStatus(Integer prePayStatus) {
        this.prePayStatus = prePayStatus;
    }

    public BigDecimal getPrePayAmount() {
        return prePayAmount;
    }

    public void setPrePayAmount(BigDecimal prePayAmount) {
        this.prePayAmount = prePayAmount;
    }

    public String getExaminerId() {
        return examinerId;
    }

    public void setExaminerId(String examinerId) {
        this.examinerId = examinerId;
    }

    public Integer getMakerId() {
        return makerId;
    }

    public void setMakerId(Integer makerId) {
        this.makerId = makerId;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getSaleOrderNumber() {
        return saleOrderNumber;
    }

    public void setSaleOrderNumber(String saleOrderNumber) {
        this.saleOrderNumber = saleOrderNumber == null ? null : saleOrderNumber.trim();
    }

    public Integer getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Integer customerId) {
        this.customerId = customerId;
    }

    public Integer getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(Integer employeeId) {
        this.employeeId = employeeId;
    }

    public Date getReceiptDate() {
        return receiptDate;
    }

    public void setReceiptDate(Date receiptDate) {
        this.receiptDate = receiptDate;
    }

    public Date getReceivingDate() {
        return receivingDate;
    }

    public void setReceivingDate(Date receivingDate) {
        this.receivingDate = receivingDate;
    }



    public Integer getBusinessType() {
        return businessType;
    }

    public void setBusinessType(Integer businessType) {
        this.businessType = businessType;
    }

    public BigDecimal getOrderDiscountRate() {
        return orderDiscountRate;
    }

    public void setOrderDiscountRate(BigDecimal orderDiscountRate) {
        this.orderDiscountRate = orderDiscountRate;
    }

    public BigDecimal getOrderDiscountAmount() {
        return orderDiscountAmount;
    }

    public void setOrderDiscountAmount(BigDecimal orderDiscountAmount) {
        this.orderDiscountAmount = orderDiscountAmount;
    }

    public BigDecimal getAmountAfOrderDis() {
        return amountAfOrderDis;
    }

    public void setAmountAfOrderDis(BigDecimal amountAfOrderDis) {
        this.amountAfOrderDis = amountAfOrderDis;
    }

    public Integer getDeliveryTyId() {
        return deliveryTyId;
    }

    public void setDeliveryTyId(Integer deliveryTyId) {
        this.deliveryTyId = deliveryTyId;
    }

    public Integer getLogisticsCompanyId() {
        return logisticsCompanyId;
    }

    public void setLogisticsCompanyId(Integer logisticsCompanyId) {
        this.logisticsCompanyId = logisticsCompanyId;
    }

    public Integer getReceiveTyId() {
        return receiveTyId;
    }

    public void setReceiveTyId(Integer receiveTyId) {
        this.receiveTyId = receiveTyId;
    }

    public Integer getHasQrCode() {
        return hasQrCode;
    }

    public void setHasQrCode(Integer hasQrCode) {
        this.hasQrCode = hasQrCode;
    }


    public String getLinkBuyOrderNumber() {
        return linkBuyOrderNumber;
    }

    public void setLinkBuyOrderNumber(String linkBuyOrderNumber) {
        this.linkBuyOrderNumber = linkBuyOrderNumber;
    }



    public String getLinkQuoteNumber() {
        return linkQuoteNumber;
    }

    public void setLinkQuoteNumber(String linkQuoteNumber) {
        this.linkQuoteNumber = linkQuoteNumber == null ? null : linkQuoteNumber.trim();
    }

    public Integer getIsExamined() {
        return isExamined;
    }

    public void setIsExamined(Integer isExamined) {
        this.isExamined = isExamined;
    }

    public Integer getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks == null ? null : remarks.trim();
    }
}